#!/bin/bash


Xcode="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/File Templates/Source/"

# Xcode="./test/"

myXcodeTemplate="./Cocoa Touch Class DIY.xctemplate/"

toXcodeTemplate="${Xcode}/${myXcodeTemplate}"

if [ -d "${toXcodeTemplate}" ]; then
	echo "移除之前的文件"
	sudo rm -rf "${toXcodeTemplate}"
fi

echo "cp -R -f ${myXcodeTemplate} ${toXcodeTemplate}"
sudo cp -R -f "${myXcodeTemplate}" "${toXcodeTemplate}"


if [ ! -d "${toXcodeTemplate}" ]; then
	echo "设置失败！"
else
	echo "设置成功！ 请重新启动Xcode"
fi
